Patch from Tom Bech <tomb@ii.uib.no>, to handle color specs of the form c
authorOwen Taylor <otaylor@gtk.org>
Sat, 13 Jun 1998 15:51:34 +0000 (15:51 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Sat, 13 Jun 1998 15:51:34 +0000 (15:51 +0000)
Sat Jun 13 11:48:26 1998  Owen Taylor  <otaylor@gtk.org>

* gdk/gdkpixmap.c (gdk_pixmap_extract_color):
Patch from Tom Bech <tomb@ii.uib.no>, to handle color
specs of the form c #abcdef [ more keys ] properly.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/gdkpixmap.c
gdk/x11/gdkpixmap-x11.c

index 27da5da24ce06464546eb685a517d407c5c699f5..567b193529827c652a6215a3932bad850c6d46d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gdk/gdkpixmap.c (gdk_pixmap_extract_color): 
+       Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+       specs of the form c #abcdef [ more keys ] properly.
+
 Sat Jun 13 10:51:56 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtkspinbutton.h gtkspinbutton.c testgtk.c 
index 27da5da24ce06464546eb685a517d407c5c699f5..567b193529827c652a6215a3932bad850c6d46d5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gdk/gdkpixmap.c (gdk_pixmap_extract_color): 
+       Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+       specs of the form c #abcdef [ more keys ] properly.
+
 Sat Jun 13 10:51:56 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtkspinbutton.h gtkspinbutton.c testgtk.c 
index 27da5da24ce06464546eb685a517d407c5c699f5..567b193529827c652a6215a3932bad850c6d46d5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gdk/gdkpixmap.c (gdk_pixmap_extract_color): 
+       Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+       specs of the form c #abcdef [ more keys ] properly.
+
 Sat Jun 13 10:51:56 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtkspinbutton.h gtkspinbutton.c testgtk.c 
index 27da5da24ce06464546eb685a517d407c5c699f5..567b193529827c652a6215a3932bad850c6d46d5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gdk/gdkpixmap.c (gdk_pixmap_extract_color): 
+       Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+       specs of the form c #abcdef [ more keys ] properly.
+
 Sat Jun 13 10:51:56 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtkspinbutton.h gtkspinbutton.c testgtk.c 
index 27da5da24ce06464546eb685a517d407c5c699f5..567b193529827c652a6215a3932bad850c6d46d5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gdk/gdkpixmap.c (gdk_pixmap_extract_color): 
+       Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+       specs of the form c #abcdef [ more keys ] properly.
+
 Sat Jun 13 10:51:56 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtkspinbutton.h gtkspinbutton.c testgtk.c 
index 27da5da24ce06464546eb685a517d407c5c699f5..567b193529827c652a6215a3932bad850c6d46d5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gdk/gdkpixmap.c (gdk_pixmap_extract_color): 
+       Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+       specs of the form c #abcdef [ more keys ] properly.
+
 Sat Jun 13 10:51:56 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtkspinbutton.h gtkspinbutton.c testgtk.c 
index 27da5da24ce06464546eb685a517d407c5c699f5..567b193529827c652a6215a3932bad850c6d46d5 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jun 13 11:48:26 1998  Owen Taylor  <otaylor@gtk.org>
+
+       * gdk/gdkpixmap.c (gdk_pixmap_extract_color): 
+       Patch from Tom Bech <tomb@ii.uib.no>, to handle color
+       specs of the form c #abcdef [ more keys ] properly.
+
 Sat Jun 13 10:51:56 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtkspinbutton.h gtkspinbutton.c testgtk.c 
index 7ba87278852490eb8b38c53425edd7f3c2931569..799bd8d462192f57598cf92771d2cae2c26183ab 100644 (file)
@@ -340,7 +340,18 @@ gdk_pixmap_extract_color (gchar *buffer)
     return NULL;
   else if (ptr[0] == '#')
     {
-      retcol = g_strdup (ptr);
+      counter = 1;
+      while (ptr[counter] != 0 && 
+             ((ptr[counter] >= '0' && ptr[counter] <= '9') ||
+              (ptr[counter] >= 'a' && ptr[counter] <= 'f') ||
+              (ptr[counter] >= 'A' && ptr[counter] <= 'F')))
+        counter++;
+
+      retcol = g_new (gchar, counter+1);
+      strncpy (retcol, ptr, counter);
+
+      retcol[counter] = 0;
+      
       return retcol;
     }
 
index 7ba87278852490eb8b38c53425edd7f3c2931569..799bd8d462192f57598cf92771d2cae2c26183ab 100644 (file)
@@ -340,7 +340,18 @@ gdk_pixmap_extract_color (gchar *buffer)
     return NULL;
   else if (ptr[0] == '#')
     {
-      retcol = g_strdup (ptr);
+      counter = 1;
+      while (ptr[counter] != 0 && 
+             ((ptr[counter] >= '0' && ptr[counter] <= '9') ||
+              (ptr[counter] >= 'a' && ptr[counter] <= 'f') ||
+              (ptr[counter] >= 'A' && ptr[counter] <= 'F')))
+        counter++;
+
+      retcol = g_new (gchar, counter+1);
+      strncpy (retcol, ptr, counter);
+
+      retcol[counter] = 0;
+      
       return retcol;
     }